// testHash.cpp : Defines the entry point for the console application.
//

#include "ChunckFile.h"
#include "FilePackage.h"
#include <Windows.h>


int main(int argc, char** argv)
{
	//CFilePackage pake;
	//pake.initHashTable( 79 );

	//pake.addSectItem( "F:\\IMG_0893.JPG" );
	//pake.addSectItem( "F:\\IMG_0894.JPG" );
	//pake.addSectItem( "F:\\IMG_0895.JPG" );
	//pake.addSectItem( "F:\\IMG_0896.JPG" );
	//
	//pake.save("fg.txt");
	//pake.close();
	int _tickcount1 = GetTickCount();

	CFilePackage gpake;
	gpake.open( "fg.txt" );
	int _tickcount2 = GetTickCount();

	int _tickSub1 = _tickcount2 - _tickcount1;
	gpake.save_2_file( "F:\\IMG_0893.JPG", "dd.jpg");




	int _tickcount3 = GetTickCount();
	int _tickSub2 = _tickcount3 - _tickcount2;

	gpake.save_2_file( "F:\\IMG_0894.JPG", "dd1.jpg");
	gpake.save_2_file( "F:\\IMG_0895.JPG", "dd2.jpg");
	gpake.save_2_file( "F:\\IMG_0896.JPG", "dd3.jpg");
	int _tickcount4 = GetTickCount();
	int _tickSub3 = _tickcount4 - _tickcount3;

	int _dataLen = 0;
	char *buf = gpake.getSectData( "F:\\IMG_0893.JPG", _dataLen );
	int _tickcount5 = GetTickCount();
	int _tickSub4 = _tickcount5 - _tickcount4;

	return 0;
}







//struct   stat   _file_stats;   

//if(stat("c:\\",   &_file_stats))   
//	return   -1;   

//return   _file_stats.st_size;  



//unsigned long ulHashValue;
//CHashCommon comm;

//ulHashValue = comm.hashString( "aaa", 0);
//printf("\n----%x----\n", ulHashValue);
//ulHashValue = comm.hashString( "aaa", 1);
//printf("\n----%x----\n", ulHashValue);
//ulHashValue = comm.hashString( "aaa", 2);
//printf("\n----%x----\n", ulHashValue);


//CChunkFileWriter dd;
////dd.open()
//CChunkWrite *ff = dd.openChunk( "ome" );
//CChunkWrite *ff1 = dd.openChunk( "ome1" );

//
////ff->beginWrite();

//int d = 9;

//struct st
//{
//	int a;
//	int b;
//	int c;
//};
//st bnum;
//bnum.a = 0;
//bnum.b = 1;
//bnum.c = 2;

//st bnum1;
//bnum1.a = 10;
//bnum1.b = 11;
//bnum1.c = 12;
//
//ff->write( &bnum, sizeof(st));

//ff->endWrite();
//ff1->beginWrite();
//ff1->write( &bnum1, sizeof(st));
//ff1->endWrite();
//dd.save( "dd.txt");

//CChunkFileReader fileReader;
//fileReader.open("dd.txt");
//CChunkRead *pRc = fileReader.openChunk("ome");
//CChunkRead *pRc1 = fileReader.openChunk("ome1");

//st oov;
//pRc->read( oov );
//st oov1;
//pRc->read( oov1 );

//CFilePackage pac;
//pac.save( "test.txt" );

//CFilePackage pac1;
//pac1.open( "test.txt");